using Asxsyd92Core.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using WebOS.Dal;

namespace WebOS.Modle
{
    [TableName("Dictionary")]
    [Description("Dictionary")]
    public partial class Dictionary
    {
        public System.Guid ID { get; set; }
        public System.Guid ParentID { get; set; }
        public string Title { get; set; }
        public string Code { get; set; }
        public string Value { get; set; }
        public string Note { get; set; }
        public string Other { get; set; }
        public int Sort { get; set; }
        [DbField(false)]
        public long Count { get; set; }
        [DbField(false)]
        public List<Dictionary> children
        {
            get
            {

                string sql = "select * from Dictionary where ParentID='" + this.ID + "' order by Sort";
                return DictionaryDal.Instance.GetList(sql, null).ToList();


            }
        }
        [DbField(false)]
        public Guid id { get { return this.ID; } }

        [DbField(false)]
        public string name
        {
            get { return this.Title; }

        }
        [DbField(false)]
        public string title
        {
            get { return this.Title; }

        }
        public int IsUse { get; set; }
    }
}


